package com.penghaisoft.microwms.material.web.insidewarehouse.controller;

import java.util.List;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.penghaisoft.microwms.common.controller.BaseController;
import com.penghaisoft.microwms.common.dto.RawStorageDto;
import com.penghaisoft.microwms.common.dto.TransResult;
import com.penghaisoft.microwms.common.page.Pager;
import com.penghaisoft.microwms.material.web.insidewarehouse.service.IMaterialInsideService;


/** 
* @ClassName: InsideRawStorageController 
* @Description: 原材料库存查询
* @author jzh
* @date 2018年5月17日 下午1:50:02  
*/
@RestController
@RequestMapping(value = "insidewarehouse/RawStorage")
@Slf4j
public class InsideRawStorageController extends BaseController  {
	
	@Autowired
	private IMaterialInsideService iMaterialInsideService;
	
	
	@PostMapping("list")
	public TransResult list(@RequestParam(name = "page", defaultValue = "1") int page,
                            @RequestParam(name = "rows", defaultValue = "10") int rows, RawStorageDto rawStorageDto) {
		Pager<RawStorageDto> result = iMaterialInsideService.findListByCondition(page, rows, rawStorageDto);
		return success(result);
	}
	
	/** 
	* @Title: getList 
	* @Description: 获取库存数据
	* @param @param rawStorageDto
	* @param @return  参数说明 
	* @return TransResult    返回类型
	* @author luoteng 
	* @date 2018年8月14日 上午11:53:29 
	* @throws 
	*/
	@PostMapping("get/list")
	public TransResult getList(RawStorageDto rawStorageDto) {
		List<RawStorageDto> result = iMaterialInsideService.queryStorageDtoList(rawStorageDto);
		return success(result);
	}
}
